package com.fessc.develop.entity.comvo;

import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;

/**
 * 对账工具类
 */

@Getter
@Setter
public class CheckAccumulate {
    //总金额
    private BigDecimal totalAmt;
    //总笔数
    private int totalNum;
    //总成功金额
    private BigDecimal totalSucAmt;
    //总成功笔数
    private int totalSucNum;
    //总失败金额
    private BigDecimal totalFailAmt;
    //总失败笔数
    private int totalFailNum;

    public CheckAccumulate() {
        this.totalAmt = BigDecimal.ZERO;
        this.totalNum = 0;
        this.totalSucAmt = BigDecimal.ZERO;
        this.totalSucNum = 0;
        this.totalFailAmt = BigDecimal.ZERO;
        this.totalFailNum = 0;
    }

    public void totalAmtAccumulate(BigDecimal amt) {
        this.totalAmt = this.totalAmt.add(amt);
    }

    public void totalSucAmtAccumulate(BigDecimal amt) {
        this.totalSucAmt = this.totalSucAmt.add(amt);
    }

    public void totalFailAmtAccumulate(BigDecimal amt) {
        this.totalFailAmt = this.totalFailAmt.add(amt);
    }

    public void totalNumAccumulate() {
        ++this.totalNum;
    }

    public void totalSucNumAccumulate() {
        ++this.totalSucNum;
    }

    public void totalFailNumAccumulate() {
        ++this.totalFailNum;
    }

    //统计清零
    public void clear() {
        this.totalAmt = BigDecimal.ZERO;
        this.totalNum = 0;
        this.totalSucAmt = BigDecimal.ZERO;
        this.totalSucNum = 0;
        this.totalFailAmt = BigDecimal.ZERO;
        this.totalFailNum = 0;
    }
}
